package o;

import android.app.AlertDialog;
import android.widget.Button;
import android.widget.RatingBar;
import android.widget.RatingBar.OnRatingBarChangeListener;
import java.lang.ref.WeakReference;

public class bej implements OnRatingBarChangeListener {
    WeakReference<beh> ˊ;

    public bej(beh o_beh) {
        this.ˊ = new WeakReference(o_beh);
    }

    public void onRatingChanged(RatingBar ratingBar, float f, boolean z) {
        beh o_beh = (beh) this.ˊ.get();
        if (o_beh != null) {
            Button button = ((AlertDialog) o_beh.getDialog()).getButton(-1);
            int ʼ = o_beh.ʼ();
            if (ʼ == 1) {
                if (f == 0.0f) {
                    button.setAlpha(0.38f);
                    button.setClickable(false);
                    return;
                }
                button.setAlpha(1.0f);
                button.setClickable(true);
            } else if (ʼ == 2 && f < 1.0f) {
                ratingBar.setRating(1.0f);
            }
        }
    }
}
